﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TARADesktopDoctor
{
    class PictureList
    {
        tara_wcf.ItaraServiceClient svc = new tara_wcf.ItaraServiceClient();
        //string[] _PicList = null;
        List<byte[]> pic = new List<byte[]>();
        int _Current = 0;

        internal void Init()
        {
            List<byte[]> x = new List<byte[]>();
            x = svc.readScreenShot(MainPage.patientDetail.Uid);
            foreach (byte[] p in x)
            {
                pic.Add(p);
            }//_PicList = System.IO.Directory.GetFiles(@"C:\Users\LZH\Pictures\Slide Shows", "*.png");
        }

        internal byte[] Peek()
        {
            try
            {
                return pic[_Current];
            }
            catch (ArgumentOutOfRangeException ex)
            {

            }
            return null;
        }

        internal byte[] Prev()
        {
            --_Current;
            if (_Current < 0)
                _Current = pic.Count - 1;
            return Peek();
        }

        internal byte[] Next()
        {
            ++_Current;
            if (_Current >= pic.Count)
                _Current = 0;
            return Peek();
        }
    }
}
